return {
    {
        "hrsh7th/nvim-cmp",
        -- event = "InsertChange",
        dependencies = {
            { "hrsh7th/cmp-buffer" },
            { "hrsh7th/cmp-path" },
            { "hrsh7th/cmp-cmdline" },
            { "hrsh7th/cmp-nvim-lua" },
            { "hrsh7th/cmp-calc" },
            { "kdheepak/cmp-latex-symbols" },
            {
                -- "zbirenbaum/copilot-cmp",
                -- dependencies = {
                -- "zbirenbaum/copilot.lua",
                -- },
                -- config = function()
                -- require("copilot_cmp").setup()
                -- require("copilot").setup({})
                -- end,
            },
            {
                "SirVer/ultisnips",
                dependencies = {
                    {
                        "quangnguyen30192/cmp-nvim-ultisnips",
                        config = function()
                            local cmp = require("cmp")
                            local cmp_ultisnips_mappings = require("cmp_nvim_ultisnips.mappings")
                            cmp.setup({
                                snippet = {
                                    expand = function(args)
                                        vim.fn["UltiSnips#Anon"](args.body)
                                    end,
                                },
                                -- recommended configuration for <Tab> people:
                                mapping = {
                                    ["<C-j>"] = cmp.mapping(function(fallback)
                                        cmp_ultisnips_mappings.expand_or_jump_forwards(fallback)
                                    end, {
                                        "i",
                                        "s", --[[ "c" (to enable the mapping in command mode) ]]
                                    }),
                                    ["<C-k>"] = cmp.mapping(function(fallback)
                                        cmp_ultisnips_mappings.jump_backwards(fallback)
                                    end, {
                                        "i",
                                        "s", --[[ "c" (to enable the mapping in command mode) ]]
                                    }),
                                },
                            })
                        end,
                    },
                },
                config = function()
                    vim.g.UltiSnipsSnippetsDir = "~/vimrc/.config/nvim/ultisnips"
                    vim.g.UltiSnipsSnippetDirectories = { "~/vimrc/.config/nvim/ultisnips" }
                end,
            },
            {
                "hrsh7th/cmp-nvim-lsp",
            },
        },
        config = function()
            local cmp_status_ok, cmp = pcall(require, "cmp")
            if not cmp_status_ok then
                return
            end

            local kind_icons = {
                Text = "󰉿",
                Method = "󰆧",
                Function = "󰊕",
                Constructor = "",
                Field = " ",
                Variable = "󰀫",
                Class = "󰠱",
                Interface = "",
                Module = "",
                Property = "󰜢",
                Unit = "󰑭",
                Value = "󰎠",
                Enum = "",
                Keyword = "󰌋",
                Snippet = "",
                Color = "󰏘",
                File = "󰈙",
                Reference = "",
                Folder = "󰉋",
                EnumMember = "",
                Constant = "󰏿",
                Struct = "",
                Event = "",
                Operator = "󰆕",
                TypeParameter = " ",
                Misc = " ",
            }

            cmp.setup({
                completion = {
                    completeopt = "menu,menuone,noinsert",
                },

                mapping = cmp.mapping.preset.insert({
                    ["<M-k>"] = cmp.mapping.select_prev_item(),
                    ["<M-j>"] = cmp.mapping.select_next_item(),
                    ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
                    ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
                    ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
                    ["<C-e>"] = cmp.mapping({
                        i = cmp.mapping.abort(),
                        c = cmp.mapping.close(),
                    }),
                    -- Accept currently selected item. If none selected, `select` first item.
                    -- Set `select` to `false` to only confirm explicitly selected items.
                    ["<CR>"] = cmp.mapping.confirm({ select = true }),
                }),
                formatting = {
                    fields = { "abbr", "kind", "menu" },
                    format = function(entry, vim_item)
                        vim_item.kind = kind_icons[vim_item.kind]
                        vim_item.menu = ({
                            nvim_lsp = "LSP",
                            nvim_lua = "Nvim_Lua",
                            ultisnips = "Snip",
                            buffer = "Buffer",
                            path = "Path",
                            calc = "Calc",
                            emoji = "EMOJI",
                            latex_symbols = "Latex",
                        })[entry.source.name]
                        return vim_item
                    end,
                },
                sources = {
                    { name = "ultisnips", priority = 100 },
                    { name = "nvim_lsp", priority = 80 },
                    { name = "nvim_lua", priority = 50 },
                    { name = "copilot", group_index = 2 },
                    {
                        name = "buffer",
                        option = {
                            get_bufnrs = function()
                                local bufs = {}
                                for _, win in ipairs(vim.api.nvim_list_wins()) do
                                    bufs[vim.api.nvim_win_get_buf(win)] = true
                                end
                                return vim.tbl_keys(bufs)
                            end,
                        },
                    },
                    { name = "path" },
                    { name = "calc" },
                    { name = "latex_symbols" },
                },
                confirm_opts = {
                    behavior = cmp.ConfirmBehavior.Replace,
                    select = false,
                },
                window = {
                    completion = cmp.config.window.bordered(),
                    documentation = cmp.config.window.bordered(),
                },
                experimental = {
                    ghost_text = true,
                },
            })
        end,
    },
}
